package com.jiangnanxiaoguan.interceptor;

import com.jiangnanxiaoguan.common.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author 不愿透露姓名的狂热者
 * @version 1.0
 */

@Slf4j
@RestControllerAdvice
public class OtherExceptionHandler {
    @ExceptionHandler(Exception.class)
    public Result<String> exceptionHandler(Exception ex) {
        String errorMessage = ex.getMessage();
        log.error(errorMessage);
        return Result.error("您的网络好像出了点问题~");
    }
}
